/**
 * Created with IntelliJ IDEA.
 *
 * @Author: jack_yang
 * @Date: 2024/4/26
 * @Description: Square class representing a square and its operations
 */
public class Square {

    private Integer sideLength;
    public Integer getSideLength() {
        return sideLength;
    }

    public void setSideLength(Integer sideLength) throws Exception {
        if (sideLength > 0) {
            this.sideLength = sideLength;
        } else {
            throw new Exception("输入的边长有误");
        }
    }


    public void draw() {
        System.out.println("画边长为:" + this.sideLength + "的正方形");
    }
}